LL_CORDIC_DeInit API migration

The LL de-initialization function previously available in the stm32tnxx_ll_cordic.c file within HAL1 are no longer present in HAL2. In HAL2, all LL C file ( stm32tnxx_ll_cordic.c) have been removed, leaving only the LL header files ( stm32tnxx_ll_cordic.h) that contain static inline functions.

If users need to de-initialize CORDIC using the LL layer, they have two methods:

  • Utilize STM32CubeMX2 Code Generation: Rely on STM32CubeMX2 to generate code with the LL layer for CORDIC de-initialization.

  • Replace manually the de-initialization function : Replace the LL_CORDIC_DeInit function manually with equivalent sequences using the static inline functions provided in the stm32tnxx_ll_cordic.h file, tailored to their specific configuration and requirements.

This approach ensures that the de-initialization sequence is precisely addressing the given use case based on the LL static inline functions provided in the stm32tnxx_ll_cordic.h header file.

Related concept: Remove stm32tnxx_ll_ppp.c files

Method 1: Utilize STM32CubeMX2 Code Generation

Create a new project with the STM32CubeMX2, then start the initialization.

Example Image

Generated CORDIC de-initialization sequence

The CORDIC de-initialisation sequence is generated in the mx_cordic_ll_deinit function in mx_cordic.c file under $YOUR_PROJECT_NAME$/$YOUR_PROJECT_NAME$_SW/generated/STM32Cube_CodeGen.

Comparison of HAL1 and HAL2

HAL1

HAL2

STM32CubeMX does not generate a CORDIC de-initialization function.
void mx_cordic_ll_deinit(void)
{
  LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_CORDIC);
}

Method 2: Replace manually the de-initialization functions

LL_CORDIC_DeInit() API migration

According to the used CORDIC, Implement the precise calls to LL_AHB1_GRP1_DisableClock().

Comparison of HAL1 and HAL2

HAL1

HAL2

LL_CORDIC_DeInit();
LL_AHB1_GRP1_DisableClock(LL_AHB1_GRP1_PERIPH_CORDIC);